package com.rmi.server;

import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.server.UnicastRemoteObject;

@SuppressWarnings("serial")
public class MyRemoteImpl extends UnicastRemoteObject implements MyRemote {

	protected MyRemoteImpl() throws RemoteException {
		super();
	}

	@Override
	public String sayHello() throws RemoteException {
		return "Server says Hey";
	}
	public static void main(String[] args) {
		try {
			MyRemote service=new MyRemoteImpl();
			 LocateRegistry.createRegistry(6600);  
			Naming.rebind("rmi://127.0.0.1:6600/PersonService",service);
			System.out.println("Service Start!");  
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
